<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::group(['namespace'=>'App\Http\Controllers'],function() {
    Route::get('index', 'IndexController@index');
    Route::get('test', 'IndexController@test');

// 患者列表有 Cookie
// 患者创建 有 Cookie
});

Route::middleware('check.login')->namespace('App\Http\Controllers')->prefix('trauma')->group(function(){
// Route::group(['prefix'=>'trauma','namespace'=>'App\Http\Controllers'],function(){

    // 获取 事件类型
    Route::get('getEventData','EventController@getEventData');

    // 患者相关
    Route::group(['prefix'=>'patient'],function () {
        // 患者创建 测试
        Route::get('createTest','PatientController@createTest');
        // 患者创建
        Route::post('create', 'PatientController@create');
        // 身份证识别
        Route::post('idCodeocr', 'PatientController@idCodeocr');
        Route::post('idCodeFromUpload', 'PatientController@idCodeFromUpload');
        // 省
        Route::get('getProvince','PatientController@getProvince');
        // 市
        Route::get('getCity','PatientController@getCity');
        // 区
        Route::get('getArea','PatientController@getArea');
        // 获取ICD
        Route::get('getIcdInfo','PatientController@getIcdInfo');
        // 获取患者详情
        Route::get('getPatientInfo','PatientController@getPatientInfo');
        // 获取患者列表
        Route::get('getPatientList','PatientController@getPatientList');
    });

    // 检伤相关
    Route::group(['prefix'=>'injury'],function () {
        // 初次检伤-添加-修改
        Route::post('saveOne', 'InjuryController@saveOne');
        // 获取初次检伤详情
        Route::get('getOneInjury','InjuryController@getOneInjury');
        // 二次检伤-添加-修改
        Route::post('saveTwoTrait', 'InjuryController@saveTwoTrait');
        // 二次检伤-现场检伤-保存/更新
        Route::post('saveTwoSceneB', 'InjuryController@saveTwoSceneB');
        // 获取二次检伤综合信息
        Route::get('getTwoInjuryInfo','InjuryController@getTwoInjuryInfo');
        // 获取二次检伤 伤情特点 详情
        Route::get('getTwoInjuryTrait','InjuryController@getTwoInjuryTrait');
        // 获取二次检伤 现场检伤 详情
        Route::get('getTwoInjuryScene','InjuryController@getTwoInjuryScene');
        // 获取检伤详情
        Route::get('getInjuryMess','InjuryController@getInjuryMess');
        // 伤情判断
        Route::post('setLevelMess', 'InjuryController@setLevelMess');
    });
    // 检伤相关
    Route::group(['prefix'=>'score'],function () {
        // 三次检伤-ISS评分-保存/更新
        Route::post('saveIssData', 'ScoreController@saveIssData');
        // 获取 三次检伤-ISS评分
        Route::get('getIssData','ScoreController@getIssData');
    });
    // 图片上传
    Route::post('upload', 'UploadController@upload');
    // 图片删除
    Route::get('delMedia', 'UploadController@delMedia');
});
